package it.cast.wechat.pojo;

import it.cast.wechat.dto.ProductVo;

public class Product {
    private String productId;

    private String productName;

    private Double productPrice;

    private String productImage;

    private String productDesc;

    private Integer productFlag;

    private String categoryId;

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId == null ? null : productId.trim();
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName == null ? null : productName.trim();
    }

    public Double getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(Double productPrice) {
        this.productPrice = productPrice;
    }

    public String getProductImage() {
        return productImage;
    }

    public void setProductImage(String productImage) {
        this.productImage = productImage == null ? null : productImage.trim();
    }

    public String getProductDesc() {
        return productDesc;
    }

    public void setProductDesc(String productDesc) {
        this.productDesc = productDesc == null ? null : productDesc.trim();
    }

    public Integer getProductFlag() {
        return productFlag;
    }

    public void setProductFlag(Integer productFlag) {
        this.productFlag = productFlag;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId == null ? null : categoryId.trim();
    }

    public ProductVo builderProductVo(){
        ProductVo productVo = new ProductVo();
        productVo.setProductId(this.productId);
        productVo.setProductDesc(this.productDesc);
        productVo.setProductImage(this.productImage);
        productVo.setProductFlag(this.productFlag);
        productVo.setProductName(this.productName);
        productVo.setProductPrice(this.productPrice);
        productVo.setCategory(new Category());
        productVo.getCategory().setCategoryId(this.categoryId);

        return productVo;
    }
}